def check_number(string):
    negative=0
    point=0
    isvalid=True
    for c in string:
        code=ord(c)
        if (code < 48 and code != 45 and code != 46) or code > 57:
            isvalid = False
            break
        elif code==45:negative+=1
        elif code==46:point+=1
    if negative>1:isvalid = False
    if point>1:isvalid = False
    if negative == 1 and string[0] != '-':isvalid = False
    if string[0] == '-' and string[1] == '.':isvalid = False
    if string[0] == '.'and string[1] == '-':isvalid = False
    return isvalid

a=input("请输入一个字符串：")
print(check_number(a))